<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Film discuss</title>
	<LINK href="<?echo base_url();?>css/style.css" type="text/css" rel=stylesheet>
	<LINK href="<? echo base_url(); ?>css/form_validator/validationEngine.jquery.css" type="text/css" rel=stylesheet>
	<LINK href="<? echo base_url(); ?>css/overcast/jquery-ui-1.8.19.custom.css" type="text/css" rel=stylesheet>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery-1.7.1.js"></script>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery.validationEngine.js"></script>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery-ui-1.8.19.custom.min.js"></script>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery.modalWindow.js"></script>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery.commentListGenerator.js"></script>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery.form_validator.languages/jquery.validationEngine-ru.js"></script>
</head>
<script>
	$(document).ready(function(){
		$('#body').fillCommentList('commentList', '/films_contr/comment_list', $('#addcomment').val());
		$('#boxes').hide();
		var flag = $('.auth1').text();
		if (flag != "") {
			$('#addcomment').removeAttr("disabled");
		}
		$('#addcomment').click(function(e){
			$('#body').makeModalWindow("add", "/films_contr/add_comment");
		});
	});
</script>
<body>
	<div id="container">
		<p id="error">
		<?php
		if (isset($text)) {
			echo "Внимание!".br();
			echo $text;
		}
		?>
		</p>
		<div id="top">
			<a class="navigation" href="/">Главная </a> | <a class="navigation" href="/films_contr/film_add"> Добавить фильм</a>
		<?php
			if (isset($is_auth) && ($is_auth == 1)) {
				echo "<b class='auth1'>$email</b><a class='auth' href='/main_contr/logoff'>Выйти</a>";
			}
			else {
				echo "<a class='auth' href='/main_contr/login'>Войти</a>";
			}
		?>	
		</div>
		<div id="body">
			<h1><?php echo $title;?></h1>
			<table border="1">
				<tr><td colspan="3" align="center"><img height="317" width="214" src="<?php echo $poster; ?>" /></td><td rowspan="3" width="200" align="center"><?php echo $description; ?></td></tr>
				<tr><th>Жанр</th><th>Рейтинг</th><th>Год</th></tr>
				<tr><td><?php echo $genre; ?></td><td><?php echo $imdbrating; ?></td><td><?php echo $year; ?></td></tr>
			</table>
		
			<div id="comment">		
				<h1>Комментарии</h1> <button id="addcomment" value=<?php echo $idfilms; ?> disabled>Добавить комментарий</button>
				<table border="1" id="commentList">
					<thead> 
						<tr><th>Имя пользователя</th><th>Комментарий</th><th>Дата добавления</th></tr>
					</thead>
				</table>
			</div>
			
			<div id="boxes">
				<div id="add" title="Добавление комментария">
					<form action="" method="" name="add">
					<table border="1">
						<tr>
							<td>Текст комментария:</td>
							<td><textarea class="validate[required,custom[desc]" name="comment" id="addel1"></textarea> </td>
						</tr>
					</table>
					</form>
				</div>
			</div>	
		</div>
		<!--<p id="notice"></p>-->
		<p id="footer">Разработал Утехин Е.А. 2012</p>
	</div>

</body>
</html>